package com.gruppsex.trainingdairy;


import android.app.Activity;
import android.app.ProgressDialog;
import android.content.Intent;
import android.os.Bundle;


public class SplashScreen extends Activity {
	/** Called when the activity is first created. */
	public ProgressDialog myDialog;
	private long ms = 0;
	private long splashTime = 2000;
	private boolean splashActive = true;
	private boolean paused = false;

	@Override
	public void onCreate(Bundle savedInstanceState) {

		super.onCreate(savedInstanceState);

		setContentView(R.layout.splashscreen);
		Thread mythread = new Thread() {
			public void run() {
				try {
					while (splashActive && ms < splashTime) {
						if (!paused)
							ms = ms + 80;
						sleep(80);
					}
				} catch (Exception e) {
				} finally {
					Intent intent = new Intent(SplashScreen.this,
							StartActivity.class);
					startActivity(intent);
					SplashScreen.this.finish();
				}
			}
		};
		mythread.start();
	}
}
